package com.study.agp.transition;

import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import androidx.databinding.DataBindingUtil;

import com.study.agp.R;
import com.study.agp.databinding.ActivityTransitionMainBinding;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class TransitionMainActivity extends AppCompatActivity {
    private ActivityTransitionMainBinding binding;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = DataBindingUtil.setContentView(this, R.layout.activity_transition_main);
        setContentView(binding.getRoot());

        setupToolbar();
        setupSamples();
    }

    private void setupSamples() {
        List<Sample> sampleList = Arrays.asList(
            new Sample(ContextCompat.getColor(this, R.color.sample_red), "Transitions"),
            new Sample(ContextCompat.getColor(this, R.color.sample_blue), "Shared Elements"),
            new Sample(ContextCompat.getColor(this, R.color.sample_green), "View animations"),
            new Sample(ContextCompat.getColor(this, R.color.sample_yellow), "Circular Reveal Animation")
        );

    }

    private void setupToolbar() {
        setSupportActionBar(binding.toolbar);
        ActionBar supportActionBar = getSupportActionBar();
        if (supportActionBar != null) {
            supportActionBar.setDisplayShowTitleEnabled(false);
        }
    }
}
